home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
comm
/
comm5
/
adprotam.lha
/
imagefx
/
Transfer_Anim.ifx
< prev
Wrap
Text File
|
1997-01-08
|
5KB
|
145 lines
/*
* Transfer_AnimPlus.ifx
*
* $VER: Transfer_AnimPlus.ifx 0.75 1.12.96
*
* by Frank E Lahr E-Mail vtnt@newnorth.net
*
* This macro is a little different from the other TAM.ifx. This
* macro will do more, but it does require a special program called
* "ViewT"in your 'C:' directory.
* It will make an icon and the appropiate tooltypes for use with AWeb.
*
* This arexx/macro will load a sequence of images and tile them
* to make a transfer anim. The transfer anim can then be used with
* certain web browsers.
* Thank you J.W. Wilson for your help.
* And to Phil Dietz for his program "ViewT".
*/
OPTIONS RESULTS
directory = "AWEB-II:Storage/AWeb-A_TAM/mine/"
RequestFile '"Pick a image file..."' directory '""' '#?'
IF rc ~= 0 THEN EXIT 0
fullfilepath = result
finddot = FIND(fullfilepath,'.') /* Look for the '.' in image filepath */
IF finddot = '' THEN DO
RequestNotify 'The file you selected is not indexed correctly'
EXIT
END
ELSE
filelength = length(fullfilepath) /* How long is the filepath */
dot = lastpos('.', fullfilepath) -1 /* Find position of '.' in the filepath */
index = filelength - dot /* Do the math for the index offset */
fileindex = RIGHT(fullfilepath,index) /* Define the index from the filepath */
checkindex = VERIFY(fileindex,'.0123456789') /* Checks index to see if it's numeric */
IF checkindex ~= 0 THEN DO
RequestNotify 'The file you selected is not indexed correctly'
EXIT
END
findslash = FIND(fullfilepath,'/') /* Look for the '/' in image filepath */
IF findslash = '' THEN DO /* If '/' not there, */
findcolon = FIND(fullfilepath,':') /* look for ':'. */
IF findcolon = '' THEN EXIT
ELSE
colon = lastpos(':', fullfilepath) /* Find ':' in image filepath */
file = filelength - colon /* Do the math for the file offset */
filename = RIGHT(fullfilepath,file) /* Define the file from the filepath */
END
ELSE
slash = lastpos('/', fullfilepath) /* Find position of '/' in the filepath */
file = filelength - slash /* Do the math for the file offset */
filename = RIGHT(fullfilepath,file) /* Define the file from the filepath */
name = lastpos('.', filename) -1 /* Find position of '.' in filename */
justname = LEFT(filename,name) /* Define just name from filename */
path = LEFT(fullfilepath,slash) /* Defines the path from the filepath */
directory = path /* Sets directory path for requester */
CALL SETCLIP('TAM_Dir', directory) /* Sets variable for source directory */
/* next make a temp file of the image and associated indexed files to be called later */
ADDRESS COMMAND 'c:LIST 'path||justname||'#? TO RAM:tam.temp NOHEAD QUICK'
IF rc ~= 0 THEN DO
RequestNotify 'Error listing image files.'
EXIT
END
/* sort alphabetically */
ADDRESS COMMAND 'c:Sort RAM:tam.temp TO RAM:tamlist.temp'
ADDRESS COMMAND 'c:Delete RAM:tam.temp QUIET'
wdtotal = 0
IF ~OPEN(infile, 'Ram:tamlist.temp', 'Read') THEN DO
RequestNotify 'Cannot read image files.'
END
ELSE
DO UNTIL EOF(infile)
wdtotal = wdtotal + Words(READLN(infile))
END
Close(infile)
tooltypeframes = wdtotal
Undo Off
/* More ImageFX commands */
LoadBuffer fullfilepath force /* Load first image */
GetMain /* Get image stats which are */
IF result = "" THEN EXIT /* name,width,height & depth */
PARSE VAR result name fwidth fheight depth /* Break down the variables */
tooltypesizex = fwidth
tooltypesizey = fheight
SWAP /* Put image into swap (bg) */
newfwidth = fwidth * wdtotal /* Define new image dimensions*/
CreateBuffer newfwidth fheight force /* Create new image based on */
/* first image and expanded y */
SWAP
wdtotal = 0 /* Line number of list images */
fwidth = fwidth - fwidth - fwidth /* Define roll amount */
Open(infile, 'Ram:tamlist.temp') /* Open list of image files */
DO UNTIL EOF(infile)
imagefile = READLN(infile) /* Read image file */
fullfilepath = path||imagefile /* Add path to image file */
LoadBuffer fullfilepath force /* Load image file into IFX */
If rc ~=0 THEN LEAVE
SWAP /* Put image file into swap */
SwapToBrush /* Make swap image into brush */
BrushHandle 0 0 /* Handle brush at 0x,0y */
NewArea /* Clear previous area */
AddArea 0 0 /* Define where to put image */
FreeDraw /* Draw into main buffer */
Region Full /* Select tool type (brush) */
KillBrush /* Free memory of brush */
Roll fwidth 0 /* Move image to the left */
SWAP
END
Close(infile) /* Close list of image files */
SWAP
icon = "env:sys/def_tool.info" /* Set variable to use this icon */
iconname = "def_tool" /* Set var name from previous icon */
destination = "Ram:" /* Set var path as to where to save the icon */
ADDRESS COMMAND
'c:copy 'icon' TO 'destination
'c:viewt 'destination||iconname' add "SIZE='tooltypesizex','tooltypesizey'"'
'c:viewt 'destination||iconname' add "FIRST=0,0"'
'c:viewt 'destination||iconname' add "FRAMES='tooltypeframes'"'
'c:viewt 'destination||iconname' add "DELTA='tooltypesizex',0"'
'c:viewt 'destination||iconname' add "REST=0,0"'
'c:rename 'destination||iconname'.info TO Ram:def_transferanim.info'
'c:Delete Ram:tamlist.temp'
EXIT